/*
 * GUI.cpp
 *
 *  Created on: Jul 3, 2010
 *      Author: Ry
 */

#include "GLGUI.h"
#include "gui/GUIEvent.h"
#include "gui/gl/GLComponent.h"

GLGUI::GLGUI() {
}

void GLGUI::draw() {
	glMatrixMode(GL_PROJECTION);
	glPushMatrix();
	glLoadIdentity();

	GLint viewport[4];
	glGetIntegerv(GL_VIEWPORT, viewport);
	gluOrtho2D(viewport[0], viewport[2], viewport[1], viewport[3]);

	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();
	for (unsigned int i = 0; i < components.size(); i++) {
		glLoadIdentity();
		components[i]->draw();
	}

	glMatrixMode(GL_PROJECTION);
	glPopMatrix();
	glMatrixMode(GL_MODELVIEW);
	glPopMatrix();
}

GLGUI::~GLGUI() {
}
